<?php

require_once(APPPATH.'models/component.php');

class pw_combo_box extends Component
{
    public $id          = 'pw_combo_box';
    public $title       = 'Combo Box';
    public $description = 'Dinamically generated combo box';
    public $keywords    = 'combo combobox smarty';

    public $attributes = array(
        'from' => array(
            'id'      => 'from',
            'example' => '{$object->relationship}'
        ),
        'item' => array(
            'id'      => 'item',
            'example' => '{$item}'
        ),
        'show' => array(
            'id'      => 'show',
            'example' => 'true'
        ),
        'noselection' => array(
            'id'      => 'noselection',
            'example' => 'Please, select an option'
        ),
        'noselectionvalue' => array(
            'id'      => 'noselectionvalue',
            'example' => '0'
        ),
        'name' => array(
            'id'      => 'name',
            'example' => 'name'
        ),
        'caption' => array(
            'id'      => 'caption',
            'example' => 'caption'
        ),
        'optvalue' => array(
            'id'      => 'optvalue',
            'example' => 'optvalue'
        ),
        'selectedcond' => array(
            'id'      => 'selectedcond',
            'example' => 'selectedcond'
        )
    );

    public function parseAttributes($post = null)
    {
        // change attributes as needed

        $post['from'] = str_replace(array('{','$','}'),'',$post['from']);
        $post['item'] = str_replace(array('{','$','}'),'',$post['item']);

        return $post;
    }

} // class pw_combo_box

/* End of file pw_combo_box.class.php */
/* Location: ./components/pw_combo_box/pw_combo_box.class.php */